﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamPapersManage.aspx.cs"
    Inherits="OA.Exam.ExamPapersManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>答卷管理</title>
    <link href="../Themes/Default/Style.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
        function checkAll() {
            var Myform = window.document.forms[0];
            for (var i = 0; i < Myform.elements.length; i++) {
                var c = Myform.elements[i].type;
                if (c == "checkbox" && document.all.chball.checked) {
                    Myform.elements[i].checked = true;
                }
                else {
                    Myform.elements[i].checked = false;
                }
            }
        }

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="98%">
            <tr>
                <td colspan="2" class="TitleZone">
                    答卷管理
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Label ID="LabPrompt" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 70%">
                </td>
                <td style="width: 30%">
                    &nbsp;&nbsp;
                    
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp;试卷名称：
                    <asp:TextBox ID="TxtPaperName" runat="server" CssClass="inputText"></asp:TextBox>
                    &nbsp;&nbsp;考生姓名：
                    <asp:TextBox ID="TxtUserName" runat="server" CssClass="inputText"></asp:TextBox>
                    &nbsp;&nbsp;<asp:Button ID="BtnSearcn" runat="server" Text="查询" CssClass="closebtn"
                        OnClick="BtnSearcn_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="GridViewExamPapers" runat="server" AutoGenerateColumns="false"
                        CssClass="GridViewStyle" Width="100%" AllowPaging="true" 
                        EmptyDataText="暂无考卷" onrowdatabound="GridViewExamPapers_RowDataBound">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input id="chball" type="checkbox" onclick="checkAll()" />全选
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="ChbCheck" runat="server" />
                                </ItemTemplate>
                                <HeaderStyle Width="6%" HorizontalAlign="Left" />
                                <ItemStyle Width="6%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="试卷名称">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HylPaperName" runat="server" Target="_blank" NavigateUrl='<%#String.Format("MarkPaper.aspx?examId={0}",Eval("examid")) %>' Text='<%#Eval("papername") %>'>
                                    </asp:HyperLink>
                                    <asp:HiddenField ID="HiddenFieldStatus" runat="server" Value='<%#Eval("status") %>' />
                                </ItemTemplate>
                                <ItemStyle Width="60%" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="UserName" HeaderText="考生姓名" ItemStyle-Width="8%" />
                            <asp:BoundField DataField="Score" HeaderText="得分" ItemStyle-Width="8%" />
                            <asp:TemplateField HeaderText="批阅状态">
                                <ItemTemplate>

                                    <script type="text/javascript" language="javascript">
                                        var ss = '<%#Eval("Status") %>';
                                        switch (ss) {
                                            case '1':
                                                document.write("未批阅");
                                                break;
                                            case '2':
                                                document.write("已批阅");
                                                break;
                                            default:
                                                document.write('');
                                                break;
                                        }
                                    </script>

                                </ItemTemplate>
                                <ItemStyle Width="8%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HylMark" runat="server" Target="_blank" Enabled='<%#Eval("status").ToString()=="1"?true:false %>' NavigateUrl='<%#String.Format("MarkPaper.aspx?examId={0}",Eval("examid")) %>'>批阅</asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <%--<asp:TemplateField HeaderText="设置">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LbtnSet" runat="server" CssClass="" CommandName="SetPaper" Enabled='<%#Eval("status").ToString()=="1"?true:false %>'>设置大题</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                        </Columns>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                        <PagerStyle CssClass="GridViewPagerStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
